package com.example.lxy.mapper;

import com.example.lxy.pojo.access;
import com.example.lxy.pojo.role;
import com.example.lxy.pojo.roleaccess;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface Accessmapper {
    @Select("select * from access")
    List<access> list();

    @Select("SELECT * FROM access a,role r,roleaccess ra WHERE a.id=ra.accessid AND r.rid=ra.roleid AND r.rid=#{rid}")
    List<role> listid(int rid);

    //批量删除权限
    int deleteUserAllById(Map<String,List<String>> maps);

    @Insert("insert into roleaccess(roleid,accessid) values(#{roleid},#{accessid})")
    void adds(roleaccess ra);
}
